package design.pattern.creational.factory_method;


public class Test {
    public static void main(String[] args) {

        // 实例化工厂对象
        TVFactory haierTVFactory = new HaierTVFactory();
        TVFactory hisenseTVFactory = new HisenseTVFactory();
        TVFactory lgTvFactory = new LGTVFactory();

        // 使用工厂对象创建实例
        TV haier = haierTVFactory.createTV();
        TV hisense = hisenseTVFactory.createTV();
        TV lg = lgTvFactory.createTV();

        // 通过调用 TV 接口的 getBrand 方法查看各电视对象的品牌
        assert haier != null;
        haier.getBrand();
        assert hisense != null;
        hisense.getBrand();
        assert lg != null;
        lg.getBrand();

    }
}
